<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>面试评分</title>

    <style>
        body {
            font-family: Arial, sans-serif;
        }

        button {
            background-color: rgba(145, 219, 255, 1);
            color: white;
            padding: 10px 20px;
            margin: 100px;
            cursor: pointer;
        }

        #interviewForm {
            width: 300px;
            margin: auto;
        }
    </style>

</head>
<body>
<div
        id="interviewList"
        style="display:none;"
>
    <h2>面试列表</h2>
    <ul>
        <li>
            <div class="interview-box">
                <div class="interview-info">
                    <h3>面试标题</h3>
                    <p>面试时间: </p>
                    <p>2023-04-05 10:00:00</p>
                    <button id="startInterview">开始面试</button>
                </div>
            </div>
        </li>
        <li>
            <button>面试2</button>
        </li>
        <li>
            <button>面试3</button>
        </li>

    </ul>
</div>

<div id="interviewForm" style="display:none;">
    <h2>请选择设备并输入评分</h2>
    <label for="device">设备:</label>
    <select id="device">
        <option value="mic">设备1</option>
        <option value="mic">设备2</option>
        <option value="mic">设备3</option>
        <!-- 添加更多设备选项 -->
    </select>
    <br>
    <label for="score">评分:</label>
    <input type="number" id="score" min="1" max="5">
    <br>
    <button id="submitScore">提交评分</button>
</div>
</body>


<script>
    const express = require('express');
    const bodyParser = require('body-parser'); // 用于解析请求体

    const app = express();
    app.use(bodyParser.json()); // 用于json格式的请求体

    app.post('/submit-score', (req, res) => {
        const { device, score } = req.body;
        console.log('收到评分:', device, score);
        // 这里应该有保存到数据库或其他存储的逻辑
        res.status(200).send('评分已接收');
    });

    const PORT = process.env.PORT || 3000;
    app.listen(PORT, () => console.log(`Server is running on port ${PORT}`));
</script>
</html>